package com.sc.nft.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.UserCastCountDTO;
import com.sc.nft.entity.UserEcologyCastRecordsDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.vo.ecology.UserExpendRecordsPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 生态-铸造-用户记录表-主表(sc_user_ecology_cast_records_details)数据Mapper
 *
 * @author Sun
 * @since 2023-11-02 22:17:44
 * @description 由 Mybatisplus Code Generator 创建
*/
@Mapper
public interface UserEcologyCastRecordsDetailsMapper extends BaseMapper<UserEcologyCastRecordsDetails> {

    /**
     * 分页获取支出明细
     * @param page
     * @param userId
     * @return
     */
    Page<UserExpendRecordsPageVO> expendRecordsPage(Page page, @Param("userId") Long userId,@Param("creatorId") Long creatorId);

    /**
     * 聚合每个人铸造了种藏品 每种藏品多少个
     * @return
     */
    List<UserCastCountDTO> getCountGroupUserAndCollectionId();

    Integer getCountByUserIdAndCollectionId(@Param("userId") Long userId, @Param("collectionId")Long collectionId);
}
